<template>
  <div>
    <!-- 导航栏 -->
    <nav class="navbar">
      <div class="navbar-logo">
        <img src="@/assets/logo.png" alt="logo" />
        <div class="navbar-title">
          <div class="title-main">党建平台</div>
          <div class="title-sub">红心向党</div>
          <div class="title-description">江西师范大学软件学院党建平台</div>
        </div>
      </div>
      <div class="navbar-links">
        <a href="#" class="nav-link">首页</a>
        <a href="#" class="nav-link">党建快讯</a>
        <a href="#" class="nav-link">产品价值</a>
        <a href="#" class="nav-link">党建产品安全性</a>
      </div>
      <div class="navbar-buttons">
        <button @click="goToLogin" class="register-btn">管理员登录</button>
        <button @click="goToLogin" class="login-btn">登录</button>
      </div>
    </nav>

    <!-- 轮播图区域 -->
    <section class="carousel-section">
      <el-carousel height="400px">
        <el-carousel-item v-for="(item, index) in carouselItems" :key="index">
          <img :src="item.image" alt="轮播图内容" />
          <p>{{ item.title }}</p>
        </el-carousel-item>
      </el-carousel>
    </section>

    <!-- 党建统计数据展示 -->
    <section class="stats-section">
      <div class="stat-item" v-for="(stat, index) in stats" :key="index">
        <span class="stat-number">{{ stat.number }}</span>
        <span class="stat-label">{{ stat.label }}</span>
      </div>
    </section>

    <!-- 其他内容部分 -->
    <section class="additional-content">
      <div class="text-list">
        <ul>
          <li>习近平会见出席共建“一带一路”国际合作高峰论坛的来宾</li>
          <li>习近平出席中央经济工作会议并发表重要讲话</li>
          <li>王毅主持中俄关系机制会议</li>
          <li>李强出席第十二届东亚峰会并发表讲话</li>
          <li>王沪宁会见匈牙利代表团</li>
          <li>习近平在亚太经合组织工商领导人峰会上发表主旨演讲</li>
          <li>《中国制造2025》提出打造创新型国家</li>
          <li>重要部门落实会议精神</li>
        </ul>
      </div>
      <div class="carousel-placeholder">
        <p>轮播图区域</p>
      </div>
    </section>

    <!-- 视频播放区域 -->
    <section class="video-section">
      <h3>习近平总书记重要讲话</h3>
      <video controls width="100%">
        <source src="/videos/your-video.mp4" type="video/mp4" />
        您的浏览器不支持视频播放。
      </video>
    </section>
  </div>
</template>

<script>
export default {
  name: "HeroSection",
  data() {
    return {
      carouselItems: [
        { image: "path/to/image1.jpg", title: "习近平参加纪念活动" },
        { image: "path/to/image2.jpg", title: "党的宣传标语" },
        { image: "path/to/image3.jpg", title: "党建活动的瞬间" },
      ],
      stats: [
        { number: "120", label: "党建活动" },
        { number: "3000+", label: "党员数量" },
        { number: "45", label: "党课" },
      ],
    };
  },
  methods: {
    goToLogin() {
      // 跳转到 Login 页面
      this.$router.push("/login");
    },
  },
};
</script>

<style scoped>
/* 样式内容与原始样式保持一致 */
.hero-section {
  height: 60vh;
  background-color: #c53030;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 5rem;
  box-sizing: border-box;
}

.text-content {
  max-width: 500px;
  color: white;
}

.welcome-text {
  font-size: 1rem;
  color: #ffffff;
  margin-bottom: 1rem;
}

h1 {
  font-size: 3rem;
  color: white;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1.75rem;
  color: white;
  margin-bottom: 1rem;
}

.description {
  color: white;
  margin-bottom: 1.5rem;
}

button {
  padding: 10px 20px;
  background-color: #ffb347;
  color: #b22222;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

.additional-content {
  display: flex;
  gap: 20px;
  padding: 20px 5rem;
  background-color: #f5f5f5;
  box-sizing: border-box;
}

.text-list {
  width: 30%;
  background-color: white;
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

.text-list ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

.text-list li {
  margin-bottom: 10px;
  font-size: 1rem;
  color: #333;
  border-bottom: 1px solid #eaeaea;
  padding-bottom: 5px;
}

.carousel-placeholder {
  width: 70%;
  height: 300px;
  background-color: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #666;
  border-radius: 5px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

.stats-section {
  display: flex;
  justify-content: space-around;
  margin-top: 2rem;
}

.stat-item {
  text-align: center;
  background: #f9f9f9;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-number {
  font-size: 2rem;
  color: #c53030;
  font-weight: bold;
}

.stat-label {
  font-size: 1rem;
  color: #666;
}

.video-section {
  margin-top: 2rem;
  text-align: center;
}

.navbar-title {
  color: white;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #b22222;
  padding: 1rem 2rem;
}

.navbar-logo {
  display: flex;
  align-items: center;
}

.navbar-logo img {
  width: 40px;
  height: 40px;
  margin-right: 1rem;
}

.navbar-title .title-main {
  font-size: 1rem;
  font-weight: bold;
}

.navbar-title .title-sub {
  font-size: 0.875rem;
}

.navbar-title .title-description {
  font-size: 0.75rem;
}

.navbar-links {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
}

.navbar-buttons {
  display: flex;
  gap: 1rem;
}

.register-btn,
.login-btn {
  background-color: #ffb347;
  color: #b22222;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  border: none;
  cursor: pointer;
}

.register-btn:hover,
.login-btn:hover {
  background-color: #ff8c00;
}
</style>
